<div class="zs-body" data-ng-init="
    treeFormInit('dictionary', {
        keyField:'id',
        orderObject:{order:0},
        pageSize:12,
        treeNavs:[{pid:'0',n:'所有字典项'}]
    });setConHei();">
    <div class="zs-map-tool">
        <div class="location">
            <a>首页</a>
            <i class="right-arr"></i>
            <a>运维管理</a>
            <i class="right-arr"></i>
            <a>字典管理</a>
        </div>    
        <div class="option">
            <input type="button" class="zs-btn orange" value="新建" 
                ng-click="addTreeRow('dictionary') && setDicName('dictionary') && openWindow('edit');"/>
            <input type="button" class="zs-btn orange" value="编辑" 
                ng-click="editRow('dictionary', dictionary.sRows[0]) && openWindow('edit')"/>
            <input type="button" class="zs-btn orange" value="删除 "
                ng-click="delEntitysEx('dictionary')"/>
        </div>
    </div>
    <div class="zs-tree">
        <div class="zs-nice-tab idTabs">
            <div class="tool item" style="margin-left:6px;">
                <span class="search-warpper" style="width:230px">
                    <i class="icon"></i>
                    <input type="text" class="zs-input" placeholder="字典名称" 
                        ng-model="dicTree.filterValue" 
                        ng-change="comboFilter('dicTree')"/>
                </span>
            </div>
        </div>
        <div style="margin-left: 15px;margin-top: 15px;margin-right: 15px;">
            <ag-Tree fn="dicTree"
                para="{ uDictionary:true,
                    dictionary:'f_metadata_directory',
                    checkbox:false,
                    showCode:true,
                    pidField:'pid',
                    leafField:'leaf',
                    intLoadLevel:2}"
                onselect="dicSearch"
                datafilter="dicFilter"
                ng-model='o'/>
        </div>
    </div>
    <div class="zs-content withTree" style="position:unset">
        <div class="zs-nice-tab idTabs">
            <div class="tool item" style="margin-left:6px;">
                
                <span class="search-warpper">
                    <i class="icon"></i>
                    <input type="text" class="zs-input" placeholder="字典项名称" ng-model="dictionary.queryObject['display:like']"/>
                </span>
            </div>
            <div class="operation item">
                <a class="ope-1" ng-click="loadData('dictionary')"></a>
                <a class="ope-2"></a>
            </div>
            <div class="tool item" style="width: 380px">
                <div class="zs-nav">
                    <a ng-click="preNav('dictionary')">返回上一级</a> | 
                    <span ng-repeat="r in dictionary.treeNavs">
                        <a ng-click="indexNav('dictionary',$index)">{{r.n}}</a> 
                        <label ng-if="$index!=dictionary.treeNavs.length-1"> > </label>
                    </span>
                </div>
            </div>
            <div class="switch">
            </div>
        </div>

        <div class="zs-data-table">
            <div class="container">
                <table>
                    <thead>
                        <tr>
                            <th>
                                <input id="allCheckbox" type="checkbox"
                                    ng-click="selectAll('dictionary','allCheckbox');">
                            </th>
                            <th>序号</th>
                            <th>名称(ID/代码)</th>
                            <th>是否有效/子节点</th>
                            <th>拼音简称</th>
                            <th>单位</th>
                            <th>备注</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr ng-repeat="r in dictionary.datas">
                            <td><input type="checkbox"
                                    ng-click="selectRow('dictionary',r);"
                                    ng-model="r.selected" />
                            </td>
                            <td>
                                <a ng-click="!r.leaf && addNav('dictionary',r.id,r.display)">
                                    <label ng-bind="r.order"></label>
                                </a>
                            </td>
                            <td>
                                <a ng-click="editRow('dictionary',r) && openWindow('edit');">
                                    <label ng-bind="r.display"></label>(<label ng-bind="r.id"></label>/<label ng-bind="r.code"></label>)
                                </a>
                            </td>
                            <td>
                                <a ng-click="editRow('dictionary',r) && openWindow('edit');">
                                    <label ng-bind="r.valid | asChineseBool"></label>
                                    /
                                    <label ng-bind="r.leaf | asChineseBool"></label>
                                </a>
                            </td>
                            <td>
                                <a ng-click="editRow('dictionary',r) && openWindow('edit');">
                                    <label ng-bind="r.abbreviation"></label>
                                </a>
                            </td>
                            <td>
                                <a ng-click="editRow('dictionary',r) && openWindow('edit');">
                                    <label ng-bind="r.units"></label>
                                </a>
                            </td>
                            <td>
                                <a ng-click="editRow('dictionary',r) && openWindow('edit');">
                                    <label ng-bind="r.info"></label>
                                </a>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="zs-pagination-box">
            <ag-Page fn='dictionary'></ag-Page>
        </div>

        <div ag-Window id="edit" title="字典项编辑" width='560px' height='220px'>
            <div class="zs-form-tab ibox">
                <form name="form" novalidate>
                    <table width="100%">
                        <tbody>
                            <tr>
                                <td class="text" width="20%">*ID</td>
                                <td class="left" width="30%">
                                    <input type="text" ng-model="dictionary.editRow.id"
                                        class="zs-input" ng-if="dictionary.editRow.FIELD_ISNEW" required>
                                    <label ng-bind="dictionary.editRow.id"
                                        ng-if="!dictionary.editRow.FIELD_ISNEW"></label>
                                </td>
                                <td class="text" width="20%">*名称</td>
                                <td class="left" width="30%"><input type="text"
                                    ng-model="dictionary.editRow.display"
                                    class="zs-input" required></td>
                            </tr>
                            <tr>
                                <td class="text" width="20%">*代码</td>
                                <td class="left" width="30%"><input type="text"
                                    ng-model="dictionary.editRow.code"
                                    class="zs-input" required></td>
                                <td class="text" width="20%">简称</td>
                                <td class="left" width="30%"><input type="text"
                                    class="zs-input" ng-model="dictionary.editRow.abbreviation"></td>
                            </tr>
                            <tr>
                                <td class="text" width="20%">单位</td>
                                <td class="left" width="30%"><input type="text"
                                    class="zs-input" ng-model="dictionary.editRow.units"></td>
                                <td class="text" width="20%"></td>
                                <td class="left" width="30%">
                                    <input type="checkbox" ng-model="dictionary.editRow.valid"
                                        ng-true-value="true" ng-false-value="false" value='false' />
                                    有效 
                                    <input type="checkbox" ng-model="dictionary.editRow.leaf"
                                        ng-true-value="true" ng-false-value="false" value='false' />
                                    子节点
                                </td>
                            </tr>
                            <tr>
                                <td class="text" width="20%">序号</td>
                                <td class="left" width="30%"><input type="text"
                                    class="zs-input" ng-model="dictionary.editRow.order">
                                </td>
                                <td class="text" width="20%">描述</td>
                                <td class="left" width="30%"><input type="text"
                                    class="zs-input" ng-model="dictionary.editRow.info"></td>
                            </tr>
                        </tbody>
                        <tfoot>
                            <tr>
                                <td colspan="4">
                                    <input type="button" name="ok" value="保存" class="zs-btn c-red"
                                        ng-click="formValidate(form) && save('dictionary', dictionary.editRow, saveCloseWindow)"/>
                                    <input type="button" name="ok" value="取消" class="zs-btn c-green" 
                                        ng-click="closeWindow('edit')" />
                                </td>
                            </tr>
                        </tfoot>
                    </table>
                </form>
            </div>
        </div>
    </div>
</div>